<!DOCTYPE html>
<html lang="en" >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <script src="layui-v2.5.5/layui/layui.all.js"></script>
    <script src="layui-v2.5.5/layui/css/layui.css"></script>
    <script src="bootstrap-3.3.7-dist/js/jquery-3.4.1.min.js"></script>
    <script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>


    <style>
        .layout {
            width: 375px;
            height: 667px;
            margin: 50px auto;
            border: solid gray 0px;
        }
        button[type='submit'] {
            position: relative;
            left: 12%;
            width: 270px;
            height: 50px;
        }
        img {
            position: absolute;
            left: 33.5%;
            top: -16%;
        }
        form {
            width: 100%;
        }
        div.col-sm-9 {
            margin: auto 11%;
        }
    </style>
</head>
<body>
<div class="layout">
    <img src="pic/logo.png" alt="">
    <br><br><br><br><br><br> <br><br><br><br><br><br>

    <form class="form-horizontal" action="" class="_form01">
        <div class="form-group has-success has-feedback">
            <div class="col-sm-9">
                <div class="input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
                    <input name="pname" type="text" class="form-control" id="pname" aria-describedby="inputGroupSuccess2Status" placeholder="请输入姓名">
                </div>
                <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <span id="inputGroupSuccess2Status=" class="sr-only">(success)</span>
            </div>
        </div>
        <div class="form-group has-success has-feedback">
            <div class="col-sm-9">
                <div class="input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                    <input name="pcode" type="text" class="form-control" id="pcode" aria-describedby="inputGroupSuccess2Status" placeholder="请输入身份证号码">
                </div>
                <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <span id="inputGroupSuccess2Status" class="sr-only">(success)</span>
            </div>
        </div>
        <div class="form-group has-success has-feedback">
            <div class="col-sm-9">
                <div class="input-group">
                    <span class="input-group-addon"><span class="glyphicon glyphicon-phone"></span></span>
                    <input name="pphone"type="text" class="form-control" id="pphone" aria-describedby="inputGroupSuccess2Status" placeholder="请输入手机号">
                </div>

                <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                <span id="inputGroupSuccess2Status1" class="sr-only">(success)</span>
            </div>
        </div>
        <br><br>


    </form>
    <button class="btn btn-success" id="sub">提交</button>



</div>
</body>
<script src="js/jquery-3.3.1.js">    </script>
<script>

    function func0(){
         var obj0 = document.getElementById("text0").value;
         var reg0=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._-]){3,15}$/;
          if(!reg0.test(obj0) )
             {
                 alert('对不起，用户名格式错误');
             }
         else
            alert("用户名格式验证正确！");
         }

    $("#sub").on("click",function () {
        $.ajax({
            url:"/people/regis",
            data:{"pcode":$("#pcode").val(),"pphone":$("#pphone").val(),"pname":$("#pname").val()},
            type:"post",
            success:function(data){
                if(data=="200"){
                    layer.msg("注册成功");
                    show();
                }else{
                    layer.msg("注册失败，请重新输入");


                }

            }
        })
    })

    var timeout = 5;
    function show() {

        var showbox = $(".showbox");
        showbox.html(timeout);
        timeout--;
        if (timeout == 0) {
            window.opener = null;

            window.location.href="login.html";
        }
        else {
            setTimeout("show()", 1000);
        }
    }
</script>
</html>

